<?php

Route::namespace('Api')->prefix('v1')->middleware('cors')->group(function () {
    Route::any('member_card_orders/notify', 'MemberCardOrdersController@notify'); // 会员卡订单微信支付回调
    Route::any('coach_orders/notify', 'CoachOrdersController@notify'); // 私教订单微信支付回调
    Route::any('group-course-orders/notify', 'GroupCourseOrderController@notify'); // 团课订单微信支付回调

    Route::get('users','UserController@index');
    Route::post('users/{id}/update-phone', 'UserController@updatePhone');
    Route::get('users/me', 'UserController@me');
    Route::get('tenant/info', 'TenantController@info');
    Route::group(['prefix' => 'member_cards'], function() {
        Route::get('/', 'MemberCardsController@index');
//        Route::post('/', 'MemberCardsController@store');
    });
    Route::resource('member_card_orders', 'MemberCardOrdersController');
    Route::middleware('api.refresh')->group(function () {
        Route::resource('member_card_orders', 'MemberCardOrdersController');
        Route::resource('coach_orders', 'CoachOrdersController');
        Route::post('group-course-orders/{id}/audit', 'GroupCourseOrderController@audit');
        Route::post('group-course-orders/{id}/cancel', 'GroupCourseOrderController@cancel');
        Route::resource('group-course-orders', 'GroupCourseOrderController');
    });
    Route::resource('coaches', 'CoachController');
    Route::resource('group-courses', 'GroupCourseController');
    Route::get('get-all-in-one', 'NoticeController@getAllInOne');
    Route::resource('notices', 'NoticeController');
});
